/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package questionbook.service;

import java.util.List;
import questionbook.model.Person;
import questionbook.service.common.GenericService;

/**
 * This Services holds all Methods that handle Friendship-Activities
 *
 * @author stefanstift
 */
public interface FriendshipService extends GenericService {

    /**
     *
     * @param p
     * @return a List of Users that invited the specified Person to be their friend
     */
    public List<Person> getInvitationsPersons(Person p);

    /**
     * @param p
     * @return a List of Users that were invited from the specified Person
     */
    public List<Person> getInvitedPersons(Person p);

    /**
     *
     * @param p
     * @return all Frineds for a specified Person
     */
    public List<Person> getFriends(Person p);

    /**
     * Persits a Friendship-Invitation in the store
     *
     * @param source the User who asks for the Friendship
     * @param target the User who is asked for the Friendship
     */
    public void addInvitation(Person source, Person target);


    /**
     * Removes the Invitation and persists a Friendship of the two
     * specified Users
     *
     * @param target
     * @param source
     */
    public void confirmInvitation(Person target, Person source);

    /**
     * Removes teh Invitation, no Friendship gets stored
     *
     * @param target
     * @param source
     */
    public void declineInvitation(Person target, Person source);

    /**
     * Persists a Friendship of two Users
     * 
     * @param p1 Friend #1
     * @param p2 Friend #2
     */
    public void addFriendship(Person p1, Person p2);

    /**
     * Deletes the Friendship of two Users
     *
     * @param p1 Friend #1
     * @param p2 Friend #2
     */
    public void deleteFriendship(Person p1, Person p2);


}
